import { Controller, Get, Inject } from '@nestjs/common';
import { AppService } from './app.service';

@Controller({
  version: '2',
})
export class App2Controller {
  constructor(
    private readonly appService: AppService,
    @Inject('person1') private readonly person1: { name: string; age: number },
    @Inject('person4') private readonly person4: { name: string; age: number },
  ) {}

  @Inject('person2')
  private person2: { name: string; age: number };

  @Inject('person3')
  private person3: { name: string; desc: string };

  @Inject('person5')
  private person5: { name: string; age: number };

  @Get()
  test(): string {
    return (
      this.appService.test() +
      this.person1.name +
      this.person2.name +
      this.person3.desc +
      this.person4.name +
      this.person5.name
    );
  }

  @Get('/testVersion')
  testVersion() {
    return '版本2';
  }
}
